'use strict'

//定义数据库中users表的结构，规定类型

module.exports = (app) => {
  const mongoose = app.mongoose
  const Schema = mongoose.Schema

  const UserSchema = new Schema({
    userName: {
      type: String,
      unique: false,
      required: true,
    },
    createDate: {
      type: Date,
      required: true,
    },
    updtaeDate: {
      type: Date,
      required: false,
    },
  })
  return mongoose.model('User', UserSchema)
}
